<template>
  <div class="page">
    <div class="header-container">
      <el-input size="mini" style="width:200px;" v-model="input_1" clearable placeholder="请输入内容"></el-input>
      <el-input size="mini" style="width:400px;" v-model="input_2" placeholder="请输入内容"></el-input>
      <el-date-picker style="width:200px;" v-model="value2" type="daterange" size="mini" align="right" unlink-panels
        range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
      </el-date-picker>
      <el-row>
        <el-button size="mini" type="primary">主要按钮</el-button>
        <el-button size="mini" type="success">成功按钮</el-button>
      </el-row>
    </div>
    <div class="middle-container">
      <div class="left-container" style="width:200px">
        <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" style="margin-top: 20px;"></el-tree>
      </div>
      <div class="right-container" style="width:800px">
        <el-row style="width:100%;margin-top: 10px;" >
          <el-button size="mini" type="primary">新增</el-button>
          <el-button size="mini" type="success">修改</el-button>
          <el-button size="mini" type="danger">删除</el-button>
            <el-button size="mini" type="warning">导出</el-button>
        </el-row>
        <el-table :data="tableData" stripe style="width: 100%">
          <el-table-column prop="date" label="日期" width="180">
          </el-table-column>
          <el-table-column prop="name" label="姓名" width="180">
          </el-table-column>
          <el-table-column prop="address" label="地址">
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input_1: '',
      input_2: '',
      data: [{
        label: '一级 1',
        children: [{
          label: '二级 1-1',
          children: [{
            label: '三级 1-1-1'
          }]
        }]
      }, {
        label: '一级 2',
        children: [{
          label: '二级 2-1',
          children: [{
            label: '三级 2-1-1'
          }]
        }, {
          label: '二级 2-2',
          children: [{
            label: '三级 2-2-1'
          }]
        }]
      }, {
        label: '一级 3',
        children: [{
          label: '二级 3-1',
          children: [{
            label: '三级 3-1-1'
          }]
        }, {
          label: '二级 3-2',
          children: [{
            label: '三级 3-2-1'
          }]
        }]
      }],
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    };
  },

  methods: {
    handleNodeClick(data) {
      console.log(data);
    }
  }
};
</script>

<style>
.page {
  display: flex;
  flex-direction: column;
}

.header-container {
  display: flex;
}

.middle-container {
  display: flex;
  flex-wrap: nowrap;
}
</style>